import { createApp } from "vue";
import App from "./App.vue";
// 通用样式
import "@/assets/scss/all.scss";

// 路由
import router from "./router";

// pinia状态管理   持久化导入
import pinia from "./store/modules/index";
// ElementPlus组件
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

// vant组件库
import Vant from "vant";
import "vant/lib/index.css";

// 引入全局组件undraw-ui
import UndrawUi from "undraw-ui";
import "undraw-ui/dist/style.css";

// 引入mockjs
import "../mock/index.js";

const app = createApp(App);

app.use(router);
app.use(pinia);
app.use(ElementPlus);

// vant组件
app.use(Vant);

// ant-design-vue组件
app.use(UndrawUi);

const rootValue = 16;
const rootWidth = 390;
const deviceWidth = document.documentElement.clientWidth;
document.documentElement.style.fontSize =
  (deviceWidth * rootValue) / rootWidth + "px";


app.mount("#app");
